package com.brk.socket.common;

/**
 * @author brk
 * @date 2023/7/13 18:52
 * @description
 */
public enum ResultCodeEnum {

    /**
     * 结果枚举类，统一管理
     */
    SUCCESS(200, "操作成功"),
    UNKNOWN_ERROR(-1, "系统繁忙，请稍后再试"),
    SAFE(203, "在围栏内"),
    UNSAFE(202, "儿童报警"),

    /**
     * 全局捕获异常
     */
    ERROR_POINT_NULL(601,"空指针异常，没有设置围栏信息"),
    ERROR_EXCEPTION(602,"离开围栏"),
    ERROR_REQUEST(603,"请求错误"),
    ERROR_REQUEST_PARAM(604,"请求异常，方法参数类型不匹配"),
    ERROR_REQUEST_FILE(605,"请求异常，请求中不含文件信息，请求头错误或文件传输错误"),

    /**
     *
     */
    USER_EXIT(5000,"用户已存在"),
    USER_NOT_EXIT(5001,"用户不存在"),
    TOKEN_EXPIRE(1001, "token过期"),
    TOKEN_ILLEGAL(1002,"token非法"),
    LOGIN_FAILURE(501, "用户名或密码错误");




    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


}
